package com.hpin.mlxteacher.my;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.hpin.mlxteacher.R;
import com.hpin.mlxteacher.base.BaseActivity;
import com.hpin.mlxteacher.utils.CommonUtils;

/**
 * 更改学校班级
 * Created by Aaron on 15/7/31.
 */
public class ChangeSchoolActivity extends BaseActivity {

    private EditText et_school;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_chage_name);

        initWidget();
    }

    private void initWidget() {

        ImageView tv_left = (ImageView) findViewById(R.id.iv_left);
        TextView tv_title = (TextView) findViewById(R.id.tv_title);
        TextView tv_right = (TextView) findViewById(R.id.tv_right);

        tv_title.setText(getResources().getString(R.string.change_grade));
        tv_right.setText(getResources().getString(R.string.done));

        tv_left.setOnClickListener(this);
        tv_right.setOnClickListener(this);

        et_school = (EditText) findViewById(R.id.et_name);
    }

    @Override
    public void widgetClick(View v) {

        switch (v.getId()) {
            case R.id.iv_left:
                finish();
                break;
            case R.id.tv_right:

                String name = et_school.getText().toString().trim();

                if (CommonUtils.isNull(name)) {

                    showToast("班级不能为空");
                    return;
                }

                break;

        }
    }
}
